#include "Loja3.h"
#include "ParedesArthur.h"
#include "TelefoneArthur.h"
#include "balcaolucaseduardo.h"
#include "SawedOffShotgunRacruvido.h"
#include "QuadBarreledShotgunRacruvido.h"
#include "M79Racruvido.h"
#include "ShotgunShellRacruvido.h"
#include "MesinhaRacruvido.h"
#include "LiquidificadorCamila.h"
#include "CameraSegurancaIsmalia.h"
#include "VentiladorCamila.h"
#include "CafeteiraCamila.h"
#include "MesaCamila.h"
#include "PortaCanetasCamila.h"
#include "abacoismalia.h"
#include "mostruarioismalia.h"
#include "relogioismalia.h"
#include "bonecoelfoismalia.h"
#include "tabuleirodamasismalia.h"
#include "HanoiArthur.h"
#include <cmath>

Scene * loja3Scene() {
  Scene * loja = new Scene();

  Matrix4 identity, scale, trans, rotat;

  loja->addObject(new ParedesArthur(), identity);

  trans = translationMatrix(Vector3(0.0, 0.0, -2.95));
  loja->addObject(new BalcaoLucasEduardo(), trans);

  rotat = rotationMatrix(M_PI/6.0,Vector3(0,1,0));
  scale = scaleMatrix(0.014);
  trans = translationMatrix(Vector3(1, 1.02, -2.97));
  loja->addObject(new TelefoneArthur(), trans*scale*rotat);

  rotat = rotationMatrix(rad(45),Vector3(0,1,0)) * rotationMatrix(rad(10),Vector3(1,0,0));
  scale = scaleMatrix(0.3);
  trans = translationMatrix(Vector3(0.86, 1.18, -3.6));
  loja->addObject(new SawedOffShotgunRacruvido(), trans*scale*rotat);

  rotat = rotationMatrix(rad(60),Vector3(1,0.0,0.0));
  scale = scaleMatrix(0.4);
  trans = translationMatrix(Vector3(3.4, 0.75, -3.6));
  loja->addObject(new M79Racruvido(), trans*scale*rotat);

  rotat = Matrix4();
  scale = scaleMatrix(0.3);
  trans = translationMatrix(Vector3(1.2, 1.06, -3.70));
  loja->addObject(new ShotgunShellRacruvido(), trans*scale*rotat);

  rotat = rotationMatrix(rad(92),Vector3(1,0,0));
  scale = scaleMatrix(0.3);
  trans = translationMatrix(Vector3(1.1, 1.11, -3.70));
  loja->addObject(new ShotgunShellRacruvido(), trans*scale*rotat);

  rotat = rotationMatrix(rad(45),Vector3(0,1,0));
  scale = scaleMatrix(0.25);
  trans = translationMatrix(Vector3(-13.5, 13.25, -14.5));
  loja->addObject(new CameraSegurancaIsmalia(), scale*trans*rotat);

  rotat = rotationMatrix(rad(135),Vector3(0,1,0));
  scale = scaleMatrix(0.35);
  trans = translationMatrix(Vector3(-1.15, 1.11, -3));
  loja->addObject(new VentiladorCamila(), trans*scale*rotat);

  // Mesa a esquerda da loja (com Cafeteira):
  rotat = Matrix4();
  scale = scaleMatrix(0.4);
  trans = translationMatrix(Vector3(-3.4,0.0,0.0));
  loja->addObject(new MesinhaRacruvido(), trans*scale*rotat);

  rotat = rotationMatrix(rad(90),Vector3(0.0,1.0,0.0));
  scale = scaleMatrix(0.4);
  trans = translationMatrix(Vector3(-3.4,1.035,0.0));
  loja->addObject(new CafeteiraCamila(), trans*scale*rotat);

  // Mesa a direita da loja (com Liquidificador):
  rotat = rotationMatrix(rad(90),Vector3(0.0,1.0,0.0));
  scale = scaleMatrix(0.7);
  trans = translationMatrix(Vector3(3.35,0.0,0.0));
  loja->addObject(new MesaCamila(), trans*scale*rotat);

  rotat = rotationMatrix(rad(-45),Vector3(0.0,1.0,0.0));
  scale = scaleMatrix(0.24);
  trans = translationMatrix(Vector3(3.4,1.03,0.0));
  loja->addObject(new Liquidificador(), trans*scale*rotat);

  rotat = Matrix4();
  scale = scaleMatrix(0.22);
  trans = translationMatrix(Vector3(0.0,1.025,-2.95));
  loja->addObject(new PortaCanetasCamila(), trans*scale*rotat);

  rotat = rotationMatrix(rad(-90), Vector3(0.0,1.0,0.0));
  scale = scaleMatrix(1.0);
  trans = translationMatrix(Vector3(-3.6, 2.15, 1.7));
  loja->addObject(new AbacoIsmalia(), trans*scale*rotat);

  rotat = Matrix4();
  scale = scaleMatrix(1.0);
  trans = translationMatrix(Vector3(-3.65,0.0,2.0));
  loja->addObject(new MostruarioIsmalia(), trans*scale*rotat);

  rotat = Matrix4();
  scale = scaleMatrix(1.0);
  trans = translationMatrix(Vector3(-3.65,1.25,2.0));
  loja->addObject(new MostruarioIsmalia(), trans*scale*rotat);
  
  rotat = Matrix4();
  scale = scaleMatrix(1.5);
  trans = translationMatrix(Vector3(0.0,1.0,-4.0));
  loja->addObject(new RelogioIsmalia(), trans*scale*rotat);
  
  rotat = rotationMatrix(rad(90), Vector3(0.0,1.0,0.0));
  scale = scaleMatrix(1.0);
  trans = translationMatrix(Vector3(-3.6,0.38,1.5));
  loja->addObject(new BonecoElfoIsmalia(), trans*scale*rotat);
  
  rotat = rotationMatrix(rad(-90), Vector3(1.0,0.0,0.0));
  scale = Matrix4();
  trans = translationMatrix(Vector3(-3.8,2.3,3.6));
  loja->addObject(new TabuleiroDamasIsmalia(), trans*scale*rotat);

  rotat = rotationMatrix(rad(90), Vector3(0.0,1.0,0.0));
  scale = scaleMatrix(0.12);
  trans = translationMatrix(Vector3(-3.6,1.038,2.23));
  loja->addObject(new HanoiArthur(), trans*scale*rotat);



  /// === NOVO!!! === NOVO!!! === NOVO!!! === NOVO!!! === NOVO!!! === NOVO!!! ===

  rotat = Matrix4();

  rotat = rotat * rotationMatrix(rad(-135),Vector3(0,1,0));

  rotat = rotat * rotationMatrix(rad(-60),Vector3(1,0,0));

  rotat = rotat * rotationMatrix(rad(-30),Vector3(0,0,1));

  scale = scaleMatrix(0.35); /// ok!!!

  trans = translationMatrix(Vector3(-3.4, 0.65, -3.4));

  /*
  //trans = translationMatrix(Vector3(3.4, 0.75, -3.6));
  rotat = rotationMatrix(rad(60),Vector3(1,0.0,0.0));
  trans = translationMatrix(Vector3(3.4, 0.0, -3.6));
  */
  loja->addObject(new QuadBarreledShotgunRacruvido(), trans*scale*rotat);


  return loja;
}
